﻿<local:DocumentBase x:Class="WPFExcelReport.GDELIVERY"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                      
                    Loaded="Window_Loaded"
                    Title="GDELIVERY"  
                    >
    <local:DocumentBase.Resources>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="190" />
            <RowDefinition Height="500" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Content="刷新数据" Height="30" Margin="0,0,0,0"  Name="btnUpdate" Width="90" Click="btnUpdate_Click"/>
            <TextBlock FontSize="18"  Height="24"   Width="63"  Margin="5,0,0,0" Text="后整厂:" VerticalAlignment="Center" />
            <TextBox  FontSize="18" Height="38"    Width="87" Name="txtFACTORY"   Margin="5,0,0,0"  Background="Bisque"/>
            <Label Content="品种:"  Width="46"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
            <TextBox Name="txtArticle" Text="" Width="144"  HorizontalAlignment="Left" Background="Azure" FontSize="18" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
            <Label Content="缸号:"  Width="46"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
            <TextBox Name="txtBATCHNO" Text="" Width="117"  HorizontalAlignment="Left" Background="Azure" FontSize="18" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
            <CheckBox Content="分段打印" Height="15" Name="txtERLKZ" Margin="10,10,0,0" Background="WhiteSmoke" IsChecked="True" />
            <Button Content="仅生成报表" Height="30" Margin="10,0,0,0"  Name="btnQuery" Width="82" Click="btnQuery_Click"/>
        </StackPanel>
        <fd:FilteringDataGrid 
            Grid.Row="1" Grid.RowSpan="2"
            CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True"
            IsFilteringCaseSensitive="False"
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding Path=WBBEW}" 
                               Margin="0,0,0,31" 
                               x:Name="WBBEWDataGrid" 
                               SelectionChanged="MainDataGrid_SelectionChanged">
            <fd:FilteringDataGrid.Columns>
                <!--WBEWBUCHUHR,FACTORY,WBBART,WBBVAR,WBBFARBE,WBBDPART,WBBLP, MTR, PCNUM -->
                <DataGridTextColumn  Binding="{Binding Path=WBEWBUCHUHR}" Header="时段" Width="SizeToHeader" MinWidth="30"/>
                <DataGridTextColumn  Binding="{Binding Path=FACTORY}" Header="后整厂" Width="SizeToCells" MinWidth="40"/>
                <DataGridTextColumn  Binding="{Binding Path=WBBART}" Header="品种" Width="SizeToCells" MinWidth="60"/>
                <DataGridTextColumn  Binding="{Binding Path=WBBVAR}" Header="变量" Width="SizeToCells" MinWidth="20"/>
                <DataGridTextColumn  Binding="{Binding Path=WBBFARBE}" Header="颜色" Width="SizeToCells" MinWidth="40"/>
                <DataGridTextColumn  Binding="{Binding Path=WBBDPART}" Header="缸号" Width="SizeToCells" MinWidth="60"/>
                <DataGridTextColumn  Binding="{Binding Path=WBBLP}" Header="库位" Width="SizeToCells" MinWidth="40"/>
                <DataGridTextColumn  Binding="{Binding Path=MTR}" Header="发坯数量" Width="SizeToCells" MinWidth="60"/>
                <DataGridTextColumn  Binding="{Binding Path=PCNUM}" Header="发坯匹数" Width="SizeToCells" MinWidth="40"/>
            </fd:FilteringDataGrid.Columns>
        </fd:FilteringDataGrid  >
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Margin="0,0,0,0">
            <fd:FilteringDataGrid IsFilteringCaseSensitive="False" AutoGenerateColumns="False" 
                                  ItemsSource="{Binding Path=WBBST}" x:Name="listWBBST" Height="659" Width="508">
                <fd:FilteringDataGrid.Columns>
                    <DataGridTextColumn  Binding="{Binding Path=WBEWBUCHUHR}" Header="时段" Width="SizeToHeader" MinWidth="30"/>
                    <DataGridTextColumn  Binding="{Binding Path=WBBSTKNR}" Header="布卷号" Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn  Binding="{Binding Path=MTR}" Header="米数" Width="SizeToCells" MinWidth="40"/>
                </fd:FilteringDataGrid.Columns>
            </fd:FilteringDataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>